package com.wallet;

//用户的银行账户
public class bank {
    private double money;
    bank(double n){
        money = n;
    }
    public double getMoney() {
        return this.money;
    }

    public void showMoney(){
        System.out.println("目前的银行卡余额为"+this.money);
    }

    public void depositFromBank(double n){
        if(n <= 0){
            System.out.println("非法参数传入");
            return;
        }
        this.money -= n;
    }

    public void CashToBank(double n){
        if(n <= 0){
            System.out.println("非法参数传入");
            return;
        }
        this.money += n;
    }

}
